struct Solution {}

impl Solution {
  pub fn num_water_bottles(num_bottles: i32, num_exchange: i32) -> i32 {
      let mut ret = num_bottles;
      let mut now = num_bottles;
      while now >= num_exchange {
          let temp = now / num_exchange;
          ret += temp;
          now = temp + now % num_exchange;
      }
      return ret;
  }
}